1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutputCacheWithControl.aspx.cs"
2 Inherits="CSASPNETOutputCache.OutputCacheWithControl" %>
4 <%@ OutputCache Duration="1000" VaryByControl="ddlOption" %>
5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml">
8 <title>OutPutCacheWithVaryByControl</title>
11 <form id="form1" runat="server">
13 <asp:Label ID="lblResult" runat="server"></asp:Label>
16 <asp:DropDownList ID="ddlOption" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlOption_SelectedIndexChanged">
17 <asp:ListItem Selected="True">Option One</asp:ListItem>
18 <asp:ListItem>Option Two</asp:ListItem>
19 <asp:ListItem>Option Three</asp:ListItem>
22 The page will be rendered from cache basing on the selected item of DropDownList.
23 The different item has corresponding cache.
26 <asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/Default.aspx">Back To Default Page</asp:HyperLink>